package day9.Exer;

public class Passenger extends Car {
    private int seat;

    public Passenger(String brand, String carNo, int rental, boolean rent, int seat) {
        super(brand, carNo, rental, rent);
        this.seat = seat;
    }
    public Passenger(){}

    public int getSeat() {
        return seat;
    }

    public void setSeat(int seat) {
        this.seat = seat;
    }
    public void showinfo(){
        System.out.println("客车  "+getBrand()+getSeat()+"座,车牌"+getCarNo()+",租金"+getRental()+"元,"+this.tostring(this.isRent()));
    }
    public void showforleasing(){
        System.out.println("您租赁的车型是"+getBrand()+"车牌号"+getCarNo()+getSeat()+"座。");
    }
    public double calRent(int day){
        if(day>=150){
            return getRental()*day*0.6;
        }else if(day>=30){
            return getRental()*day*0.7;
        }else if(day>=7){
            return getRental()*day*0.8;
        }else if(day>=3){
            return getRental()*day*0.9;
        }
        else{
            return getRental()*day;
        }
    }
}
